<?
require_once "Mail.php";
$to = "";
$host = "";
$port = "";
$username = "";
$password = "";   

$nama = $_POST['name']; // required
        $pengirim = ""; // required
        $telpon = ""; // not required
        $subjek = "Notification Cuti"; // required
        $pesan = "awawewgawegwegwegwegwegewgwegaw"; // required

$email_message .= "Name: $nama";
        $email_message .= "Email: $pengirim<br>";
        $email_message .= "Telephone: $telpon<br>";
        $email_message .= "Subject: $subjek<br>";
        $email_message .= "Comments: $pesan<br>";

$headers = array ('From' => $pengirim,
'To' => $to,
'Subject' => $subjek);       

$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));       

$mail = $smtp->send($to, $headers, $email_message);
if (PEAR::isError($mail))
{
echo("<p>" . $mail->getMessage() . "</p>");}
else {
echo "email success";
}
?>